using System;
using System.Data;
using digit.Core;

namespace SMS.UserManager
{
    [Serializable]
    public class MembersInfo
    {
        #region CONSTRUCTORS
        public MembersInfo()
        {
            this._memberID = Util.NULL_INT;
            this._fullName = Util.NULL_STRING;
            this._userName = Util.NULL_STRING;
            this._password = Util.NULL_STRING;
            this._pin = Util.NULL_STRING;
            this._identityNo = Util.NULL_STRING;
            this._email = Util.NULL_STRING;
            this._mobileNo = Util.NULL_STRING;
            this._amount = Util.NULL_INT;
            this._verifyCode = Util.NULL_STRING;
            this._createdDate = Util.NULL_DATETIME;
            this._lastLogin = Util.NULL_DATETIME;
            this._type = Util.NULL_BYTE;
            this._status = false;
        }

        public MembersInfo(int memberID, string fullName, string userName, string password, string pin, string identityNo, string email, string mobileNo, int amount, string verifyCode, DateTime createdDate, DateTime lastLogin, byte type, bool status)
        {
            this._memberID = memberID;
            this._fullName = fullName;
            this._userName = userName;
            this._password = password;
            this._pin = pin;
            this._identityNo = identityNo;
            this._email = email;
            this._mobileNo = mobileNo;
            this._amount = amount;
            this._verifyCode = verifyCode;
            this._createdDate = createdDate;
            this._lastLogin = lastLogin;
            this._type = type;
            this._status = status;
        }

        public MembersInfo(DataRow dRow)
        {
            this._memberID = (int)dRow["MemberID"];
            this._fullName = dRow["FullName"].ToString();
            this._userName = dRow["UserName"].ToString();
            this._password = dRow["Password"].ToString();
            this._pin = dRow["Pin"].ToString();
            this._identityNo = dRow["IdentityNo"].ToString();
            this._email = dRow["Email"].ToString();
            this._mobileNo = dRow["MobileNo"].ToString();
            this._amount = (int)dRow["Amount"];
            this._verifyCode = Util.ReplaceDBNullTo(dRow["VerifyCode"], Util.NULL_STRING).ToString();
            this._createdDate = (DateTime)dRow["CreatedDate"];
            this._lastLogin = (DateTime)Util.ReplaceDBNullTo(dRow["LastLogin"], Util.NULL_DATETIME);
            this._type = (byte)dRow["Type"];
            this._status = (bool)Util.ReplaceDBNullTo(dRow["Status"], false);
        }
        #endregion

        #region ATTRIBUTES
        private int _memberID;
        private string _fullName;
        private string _userName;
        private string _password;
        private string _pin;
        private string _identityNo;
        private string _email;
        private string _mobileNo;
        private int _amount;
        private string _verifyCode;
        private DateTime _createdDate;
        private DateTime _lastLogin;
        private byte _type;
        private bool? _status;
        #endregion

        #region PROPERTIES
        public int MemberID
        {
            get
            {
                return this._memberID;
            }
            set
            {
                this._memberID = value;
            }
        }

        public string FullName
        {
            get
            {
                return this._fullName;
            }
            set
            {
                this._fullName = value;
            }
        }

        public string UserName
        {
            get
            {
                return this._userName;
            }
            set
            {
                this._userName = value;
            }
        }

        public string Password
        {
            get
            {
                return this._password;
            }
            set
            {
                this._password = value;
            }
        }

        public string PIN
        {
            get
            {
                return this._pin;
            }
            set
            {
                this._pin = value;
            }
        }

        public string IdentityNo
        {
            get
            {
                return this._identityNo;
            }
            set
            {
                this._identityNo = value;
            }
        }

        public string Email
        {
            get
            {
                return this._email;
            }
            set
            {
                this._email = value;
            }
        }

        public int Amount
        {
            get
            {
                return this._amount;
            }
            set
            {
                this._amount = value;
            }
        }

        public string MobileNo
        {
            get
            {
                return this._mobileNo;
            }
            set
            {
                this._mobileNo = value;
            }
        }

        public string VerifyCode
        {
            get
            {
                return this._verifyCode;
            }
            set
            {
                this._verifyCode = value;
            }
        }

        public DateTime CreatedDate
        {
            get
            {
                return this._createdDate;
            }
            set
            {
                this._createdDate = value;
            }
        }

        public bool? Status
        {
            get
            {
                return this._status;
            }
            set
            {
                this._status = value;
            }
        }

        public byte Type
        {
            get
            {
                return this._type;
            }
            set
            {
                this._type = value;
            }
        }

        public DateTime LastLogin
        {
            get
            {
                return this._lastLogin;
            }
            set
            {
                this._lastLogin = value;
            }
        }
        #endregion
    }
}